-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overriding retry policy for SMS high priority #2008
Conversation
This looks good to me. I think that this retry is for when, for example, the boto call fails. If celery itself crashes or is killed outright then I think we have to rely on the SQS retry timeout |
(EMAIL_TYPE, PRIORITY, 48, 300), | ||
(SMS_TYPE, BULK, 48, 300), | ||
(SMS_TYPE, NORMAL, 48, 300), | ||
(SMS_TYPE, PRIORITY, 48, 26), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of hard coding these values we could pull them from RETRY_POLICY_DEFAULT
and RETRY_POLICY_HIGH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to the config values. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…' into feat/decrease-retry-for-sms-high
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still all looks good.., Is there an easy way to test locally? I guess the commented out exception you have will do it? ie run and check that it gets retried quickly?
app/celery/provider_tasks.py
Outdated
@@ -112,6 +113,7 @@ def _deliver_sms(self, notification_id): | |||
notification = notifications_dao.get_notification_by_id(notification_id) | |||
if not notification: | |||
raise NoResultFound() | |||
# raise Exception("Trigger artificial Celery retry") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 before release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah heh
@@ -43,7 +43,7 @@ | |||
"-l", | |||
"DEBUG", | |||
"-Q", | |||
"database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,send-sms-tasks,send-email-tasks,service-callbacks,delivery-receipts", | |||
"database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,normal-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,send-sms-tasks,send-sms-high,send-sms-medium,send-sms-low,send-throttled-sms-tasks,send-email-high,send-email-medium,send-email-low,send-email-tasks,service-callbacks,delivery-receipts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Yes that is the strategy I use at the moment, i.e. trigger an exception for every send of SMS so that I can test the retries. 👍 |
Summary | Résumé
These changes override the retry policy for SMS high priority.
In case where the Celery workers went down, we want to retry the high priority notifications within a 1 minute time frame to honor its SLO.
Test instructions | Instructions pour tester la modification
No tests at the moment; working on it.
Release Instructions | Instructions pour le déploiement
Test in staging by running performance tests and emulate spikes of notifications bulk that will bring up and down Celery workers.
Reviewer checklist | Liste de vérification du réviseur
This is a suggested checklist of questions reviewers might ask during their
review | Voici une suggestion de liste de vérification comprenant des questions
que les réviseurs pourraient poser pendant leur examen :
une baisse de la quantité de code couvert par les tests automatisés?
fonctionnalité existante?
modification de la politique de confidentialité?
préoccupations liées à la sécurité?
façon importante la performance?
risque d’utiliser des dépendances ajoutées?
setup, etc.) | Faudra-t-il mettre à jour la documentation à la suite de ce
changement (fichier README, etc.)?